/*
    C++作业

    夏思成

    2024年3月17日
*/

#include <iostream>
using namespace std;

void sort(int& a, int& b, int& c)
{
    int tmp = 0;

    if (a > b)
    {
        tmp = a;
        a = b;
        b = tmp;
    }

    if (a > c)
    {
        tmp = a;
        a = c;
        c = tmp;
    }

    if (b > c)
    {
        tmp = b;
        b = c;
        c = tmp;
    }

}

int main()
{
    int first = 0;
    int second = 0;
    int third = 0;

    cout << "请输入三个数：" << endl;
    cin >> first >> second >> third;

    sort(first, second, third);
    cout << "排序后的结果为：" << endl << first <<" " << second << " " << third << endl;
    return 0;
}